/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-11-04
 * Time: 10:02
 */

class Solution5 {
    public int peakIndexInMountainArray(int[] arr) {
        int left = 0 , right = arr.length , n = arr.length;
        while(left < right){
            int mid = left + (right - left + 1)/2;
            if(arr[mid] > arr[mid-1]){
                left = mid;
            }else if(arr[mid] < arr[mid-1]){
                right = mid - 1;
            }else{

            }
        }
        return left;
    }
}

public class Test5 {
}
